import React, { memo,useContext } from "react"
import './child-card.less'
import {ThemeContext} from '../../App'

export default memo(()=>{
    const data = useContext(ThemeContext)
    return <div style={{backgroundColor:data.color}} className="child">
        <span>后代组件传参</span>
        <button onClick={()=>{data.resetColorHandle()}} >重置颜色</button>
    </div>
})